package cn.tedu;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo01 {
    public static void main(String[] args) throws SQLException {
        //1. 获取连接
        try(Connection conn = DBUtils.getConn()) {
            String sql = "create table hero(id int primary key auto_increment,name varchar(20),money int)";
            //创建执行SQL语句对象
            Statement s = conn.createStatement();
            //执行创建表的SQL语句
            s.executeUpdate(sql);
            System.out.println("创建完成!");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
